<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - SocialApp</title>
    <style>
        * {
            font-family: 'Segoe UI', sans-serif;
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            text-decoration: none;
        }

        body {
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #f0f2f5;
        }

        .login-container {
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            padding: 32px 40px;
            width: 100%;
            max-width: 400px;
        }

        .login-header {
            text-align: center;
            margin-bottom: 32px;
        }

        .login-header h1 {
            color: #1a73e8;
            font-size: 2.2rem;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .login-header p {
            color: #5f6368;
            font-size: 1.1rem;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            color: #333;
            font-size: 0.95rem;
            margin-bottom: 8px;
            font-weight: 500;
        }

        .form-group input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid #dfe1e5;
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.2s ease;
        }

        .form-group input:focus {
            outline: none;
            border-color: #1a73e8;
            box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
        }

        .error-message {
            color: #db4437;
            font-size: 0.9rem;
            margin-top: 6px;
            display: none;
        }

        .has-error .error-message {
            display: block;
        }

        .login-btn {
            width: 100%;
            padding: 14px;
            background: #1a73e8;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.2s;
        }

        .login-btn:hover {
            background: #1557b3;
        }

        .social-login {
            margin-top: 24px;
            text-align: center;
        }

        .social-login p {
            color: #5f6368;
            margin-bottom: 16px;
        }

        .social-buttons {
            display: flex;
            justify-content: center;
            gap: 16px;
        }

        .social-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 1px solid #dfe1e5;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 1.6rem;
            color: #666;
            transition: all 0.2s;
        }

        .social-btn:hover {
            background: #f0f2f5;
            color: #1a73e8;
        }

        .register-link {
            text-align: center;
            margin-top: 28px;
            font-size: 0.95rem;
            color: #5f6368;
        }

        .register-link a {
            color: #1a73e8;
            font-weight: 500;
            text-decoration: none;
        }

        .register-link a:hover {
            text-decoration: underline;
        }
    </style>
    <!-- 引入Font Awesome图标库 -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/js/all.min.js"></script>
</head>
<body>
    <div class="login-container">
        <div class="login-header">
            <h1>欢迎登录</h1>
            <p>连接你的社交圈</p>
        </div>

        <c:if test="${param.error != null}">
            <div class="error-message" style="text-align: center; margin-bottom: 20px;">
                用户名或密码错误，请重新输入
            </div>
        </c:if>

        <form action="login" method="post" class="login-form">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" required>
            </div>

            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" required>
            </div>

            <button type="submit" class="login-btn">登录</button>
        </form>

        <div class="social-login">
            <p>或使用社交账号登录</p>
            <div class="social-buttons">
                <a href="#" class="social-btn"><i class="fab fa-google"></i></a>
                <a href="#" class="social-btn"><i class="fab fa-facebook-f"></i></a>
                <a href="#" class="social-btn"><i class="fab fa-twitter"></i></a>
            </div>
        </div>

        <div class="register-link">
            还没有账号？<a href="register.jsp">立即注册</a>
        </div>
    </div>
</body>
</html>